#include "user_command.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "stdint.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

void user_command_task(void *arg)
{
    printf("%s %d start\r\n", __func__, __LINE__);
    while (1) {
   	if (uart_send_flag.head != uart_send_flag.tail) {
		// printf("%s %d head:%d\r\n", __func__, __LINE__, uart_send_flag.head);
	    sendData(uart_send_flag.data[uart_send_flag.head].data, uart_send_flag.data[uart_send_flag.head].len);
	    // hexdump(uart_send_flag.data[uart_send_flag.head].data, uart_send_flag.data[uart_send_flag.head].len);
	    uart_send_flag.head = (uart_send_flag.head + 1) % UART_SEND_MAX;
	}	
    	vTaskDelay(10);	    
    }
}
